package com.x.Part2_operator;
import java.util.Scanner;//键盘输入，引入Class Scanner

public class Switch {
    public static void main(String[] args) {
        //switch表达式用法1
        //键盘seasonCode赋值
        Scanner in1 = new Scanner(System.in);
        int seasonCode = in1.nextInt();

        String seasonName1 = switch (seasonCode){
          case 0 -> "Spring";
          case 1 -> "Summer";
          case 2 -> "Fall";
          case 3 -> "Winter";
          default -> "???";
        };
        System.out.println(seasonName1);

        //switch表达式用法2
        //键盘给seasonName2赋值
        Scanner in2 = new Scanner(System.in);
        String seasonName2 = in2.nextLine();
        int numberSwitch = switch (seasonName2){
            case "Spring", "Summer", "Winter" -> 6;
            case "Fall" -> 4;
            default -> -1;
        };
        System.out.println(numberSwitch);
        
    }
}
